<template>
  <div>
    <h3>父组件</h3>
    <button @click="getChildIns">获取子组件中的count数值</button>
    <hr />
    <child ref="childRef" />
  </div>
</template>

<script>
import { ref } from 'vue'
import child from './components/child.vue'
export default {
  components: {
    child
  },
  setup() {
    const childRef = ref(null)

    const getChildIns = () => {
      console.log(childRef.value)
    }

    return {
      childRef,
      getChildIns
    }
  }
}
</script>

<style lang="scss" scoped></style>
